// 样例数据
let data = {
    name: 'jack',
    child: [
        { name: 'jack1' },
        {
            name: 'jack2',
            child: [{
                name: 'jack2-1',
                child: { name: 'jack2-1-1' }
            }, {
                name: 'jack2-2'
            }]
        },
        {
            name: 'jack3',
            child: { name: 'jack3-1' }
        }
    ]
}
function find(data){
    let namelist=[]
    function tmp(data){
        if(data.hasOwnProperty('child')){
            if(Array.isArray(data.child)){
                namelist.push(data.child)
                data.child.forEach(child=>tmp(child))
            }else{
                tmp(data.child)
            }
        }
    }
    tmp(data)
    return namelist
}